<template>
  <div class="app-container">
    <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
      <el-form-item label="预设副将ID" prop="entouragePresetsId">
        <el-input
          v-model="queryParams.entouragePresetsId"
          placeholder="请输入预设副将ID"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="玩家ID" prop="playerId">
        <el-input
          v-model="queryParams.playerId"
          placeholder="请输入玩家ID"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="名称" prop="name">
        <el-input
          v-model="queryParams.name"
          placeholder="请输入名称"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="头像" prop="profilePicture">
        <el-input
          v-model="queryParams.profilePicture"
          placeholder="请输入头像"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="等级" prop="LEVEL">
        <el-input
          v-model="queryParams.LEVEL"
          placeholder="请输入等级"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="职业" prop="career">
        <el-input
          v-model="queryParams.career"
          placeholder="请输入职业"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="头衔" prop="title">
        <el-input
          v-model="queryParams.title"
          placeholder="请输入头衔"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="经验" prop="experience">
        <el-input
          v-model="queryParams.experience"
          placeholder="请输入经验"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="忠诚" prop="loyalty">
        <el-input
          v-model="queryParams.loyalty"
          placeholder="请输入忠诚"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="成长率" prop="growthRate">
        <el-input
          v-model="queryParams.growthRate"
          placeholder="请输入成长率"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="兵力" prop="troops">
        <el-input
          v-model="queryParams.troops"
          placeholder="请输入兵力"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="兵力上限" prop="troopsLimit">
        <el-input
          v-model="queryParams.troopsLimit"
          placeholder="请输入兵力上限"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="精力" prop="energy">
        <el-input
          v-model="queryParams.energy"
          placeholder="请输入精力"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="精力上限" prop="energyLimit">
        <el-input
          v-model="queryParams.energyLimit"
          placeholder="请输入精力上限"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="防御力" prop="defenseCapability">
        <el-input
          v-model="queryParams.defenseCapability"
          placeholder="请输入防御力"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="攻击" prop="attack">
        <el-input
          v-model="queryParams.attack"
          placeholder="请输入攻击"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="速度" prop="speed">
        <el-input
          v-model="queryParams.speed"
          placeholder="请输入速度"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="生平" prop="biography">
        <el-input
          v-model="queryParams.biography"
          placeholder="请输入生平"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="无双" prop="unparalleled">
        <el-input
          v-model="queryParams.unparalleled"
          placeholder="请输入无双"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="统御" prop="control">
        <el-input
          v-model="queryParams.control"
          placeholder="请输入统御"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="谋略" prop="intelligence">
        <el-input
          v-model="queryParams.intelligence"
          placeholder="请输入谋略"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="力量" prop="power">
        <el-input
          v-model="queryParams.power"
          placeholder="请输入力量"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="敏捷" prop="agile">
        <el-input
          v-model="queryParams.agile"
          placeholder="请输入敏捷"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="备用统御" prop="controlStandby">
        <el-input
          v-model="queryParams.controlStandby"
          placeholder="请输入备用统御"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="备用谋略" prop="intelligenceStandby">
        <el-input
          v-model="queryParams.intelligenceStandby"
          placeholder="请输入备用谋略"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="备用力量" prop="powerStandby">
        <el-input
          v-model="queryParams.powerStandby"
          placeholder="请输入备用力量"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="备用敏捷" prop="agileStandby">
        <el-input
          v-model="queryParams.agileStandby"
          placeholder="请输入备用敏捷"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="初始统御" prop="controlBase">
        <el-input
          v-model="queryParams.controlBase"
          placeholder="请输入初始统御"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="初始谋略" prop="intelligenceBase">
        <el-input
          v-model="queryParams.intelligenceBase"
          placeholder="请输入初始谋略"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="初始力量" prop="powerBase">
        <el-input
          v-model="queryParams.powerBase"
          placeholder="请输入初始力量"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="初始敏捷" prop="agileBase">
        <el-input
          v-model="queryParams.agileBase"
          placeholder="请输入初始敏捷"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="洗练统御" prop="controlSuccinct">
        <el-input
          v-model="queryParams.controlSuccinct"
          placeholder="请输入洗练统御"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="洗练谋略" prop="intelligenceSuccinct">
        <el-input
          v-model="queryParams.intelligenceSuccinct"
          placeholder="请输入洗练谋略"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="洗练力量" prop="powerSuccinct">
        <el-input
          v-model="queryParams.powerSuccinct"
          placeholder="请输入洗练力量"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="洗练敏捷" prop="agileSuccinct">
        <el-input
          v-model="queryParams.agileSuccinct"
          placeholder="请输入洗练敏捷"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="命中率" prop="hitRate">
        <el-input
          v-model="queryParams.hitRate"
          placeholder="请输入命中率"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="暴击率" prop="criticalHitRate">
        <el-input
          v-model="queryParams.criticalHitRate"
          placeholder="请输入暴击率"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="反击率" prop="counterattackRate">
        <el-input
          v-model="queryParams.counterattackRate"
          placeholder="请输入反击率"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="致命率" prop="fatalityRate">
        <el-input
          v-model="queryParams.fatalityRate"
          placeholder="请输入致命率"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="法暴率" prop="lawViolenceRate">
        <el-input
          v-model="queryParams.lawViolenceRate"
          placeholder="请输入法暴率"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="反震率" prop="antiSeismicRate">
        <el-input
          v-model="queryParams.antiSeismicRate"
          placeholder="请输入反震率"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="闪避率" prop="dodgeChance">
        <el-input
          v-model="queryParams.dodgeChance"
          placeholder="请输入闪避率"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="抗物理" prop="antiPhysics">
        <el-input
          v-model="queryParams.antiPhysics"
          placeholder="请输入抗物理"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="抗玄击" prop="antiXuanStrike">
        <el-input
          v-model="queryParams.antiXuanStrike"
          placeholder="请输入抗玄击"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="抗封锁" prop="antiBlocking">
        <el-input
          v-model="queryParams.antiBlocking"
          placeholder="请输入抗封锁"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="抗扰乱" prop="antiDisturbance">
        <el-input
          v-model="queryParams.antiDisturbance"
          placeholder="请输入抗扰乱"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="抗围困" prop="antiSiege">
        <el-input
          v-model="queryParams.antiSiege"
          placeholder="请输入抗围困"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="抗风沙" prop="antiWind">
        <el-input
          v-model="queryParams.antiWind"
          placeholder="请输入抗风沙"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="抗妖火" prop="antiFire">
        <el-input
          v-model="queryParams.antiFire"
          placeholder="请输入抗妖火"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="抗毒术" prop="antiToxic">
        <el-input
          v-model="queryParams.antiToxic"
          placeholder="请输入抗毒术"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="抗落雷" prop="antiLightning">
        <el-input
          v-model="queryParams.antiLightning"
          placeholder="请输入抗落雷"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="属性点" prop="attributePoints">
        <el-input
          v-model="queryParams.attributePoints"
          placeholder="请输入属性点"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="备用属性点" prop="backupAttributePoint">
        <el-input
          v-model="queryParams.backupAttributePoint"
          placeholder="请输入备用属性点"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="武器" prop="weapon">
        <el-input
          v-model="queryParams.weapon"
          placeholder="请输入武器"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="头盔" prop="helmet">
        <el-input
          v-model="queryParams.helmet"
          placeholder="请输入头盔"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="护甲" prop="armor">
        <el-input
          v-model="queryParams.armor"
          placeholder="请输入护甲"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="护腿" prop="legging">
        <el-input
          v-model="queryParams.legging"
          placeholder="请输入护腿"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="鞋子" prop="shoe">
        <el-input
          v-model="queryParams.shoe"
          placeholder="请输入鞋子"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="饰品" prop="jewelry">
        <el-input
          v-model="queryParams.jewelry"
          placeholder="请输入饰品"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item>
        <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
        <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
      </el-form-item>
    </el-form>

    <el-row :gutter="10" class="mb8">
      <el-col :span="1.5">
        <el-button
          type="primary"
          plain
          icon="el-icon-plus"
          size="mini"
          @click="handleAdd"
          v-hasPermi="['system:entourage:add']"
        >新增</el-button>
      </el-col>
      <el-col :span="1.5">
        <el-button
          type="success"
          plain
          icon="el-icon-edit"
          size="mini"
          :disabled="single"
          @click="handleUpdate"
          v-hasPermi="['system:entourage:edit']"
        >修改</el-button>
      </el-col>
      <el-col :span="1.5">
        <el-button
          type="danger"
          plain
          icon="el-icon-delete"
          size="mini"
          :disabled="multiple"
          @click="handleDelete"
          v-hasPermi="['system:entourage:remove']"
        >删除</el-button>
      </el-col>
      <el-col :span="1.5">
        <el-button
          type="warning"
          plain
          icon="el-icon-download"
          size="mini"
          @click="handleExport"
          v-hasPermi="['system:entourage:export']"
        >导出</el-button>
      </el-col>
      <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
    </el-row>

    <el-table v-loading="loading" :data="entourageList" @selection-change="handleSelectionChange">
      <el-table-column type="selection" width="55" align="center" />
      <el-table-column label="副将ID" align="center" prop="id" />
      <el-table-column label="预设副将ID" align="center" prop="entouragePresetsId" />
      <el-table-column label="玩家ID" align="center" prop="playerId" />
      <el-table-column label="名称" align="center" prop="name" />
      <el-table-column label="头像" align="center" prop="profilePicture" />
      <el-table-column label="性别" align="center" prop="sex" />
      <el-table-column label="等级" align="center" prop="LEVEL" />
      <el-table-column label="职业" align="center" prop="career" />
      <el-table-column label="头衔" align="center" prop="title" />
      <el-table-column label="经验" align="center" prop="experience" />
      <el-table-column label="忠诚" align="center" prop="loyalty" />
      <el-table-column label="成长率" align="center" prop="growthRate" />
      <el-table-column label="兵力" align="center" prop="troops" />
      <el-table-column label="兵力上限" align="center" prop="troopsLimit" />
      <el-table-column label="精力" align="center" prop="energy" />
      <el-table-column label="精力上限" align="center" prop="energyLimit" />
      <el-table-column label="防御力" align="center" prop="defenseCapability" />
      <el-table-column label="攻击" align="center" prop="attack" />
      <el-table-column label="速度" align="center" prop="speed" />
      <el-table-column label="生平" align="center" prop="biography" />
      <el-table-column label="无双" align="center" prop="unparalleled" />
      <el-table-column label="统御" align="center" prop="control" />
      <el-table-column label="谋略" align="center" prop="intelligence" />
      <el-table-column label="力量" align="center" prop="power" />
      <el-table-column label="敏捷" align="center" prop="agile" />
      <el-table-column label="备用统御" align="center" prop="controlStandby" />
      <el-table-column label="备用谋略" align="center" prop="intelligenceStandby" />
      <el-table-column label="备用力量" align="center" prop="powerStandby" />
      <el-table-column label="备用敏捷" align="center" prop="agileStandby" />
      <el-table-column label="初始统御" align="center" prop="controlBase" />
      <el-table-column label="初始谋略" align="center" prop="intelligenceBase" />
      <el-table-column label="初始力量" align="center" prop="powerBase" />
      <el-table-column label="初始敏捷" align="center" prop="agileBase" />
      <el-table-column label="洗练统御" align="center" prop="controlSuccinct" />
      <el-table-column label="洗练谋略" align="center" prop="intelligenceSuccinct" />
      <el-table-column label="洗练力量" align="center" prop="powerSuccinct" />
      <el-table-column label="洗练敏捷" align="center" prop="agileSuccinct" />
      <el-table-column label="命中率" align="center" prop="hitRate" />
      <el-table-column label="暴击率" align="center" prop="criticalHitRate" />
      <el-table-column label="反击率" align="center" prop="counterattackRate" />
      <el-table-column label="致命率" align="center" prop="fatalityRate" />
      <el-table-column label="法暴率" align="center" prop="lawViolenceRate" />
      <el-table-column label="反震率" align="center" prop="antiSeismicRate" />
      <el-table-column label="闪避率" align="center" prop="dodgeChance" />
      <el-table-column label="抗物理" align="center" prop="antiPhysics" />
      <el-table-column label="抗玄击" align="center" prop="antiXuanStrike" />
      <el-table-column label="抗封锁" align="center" prop="antiBlocking" />
      <el-table-column label="抗扰乱" align="center" prop="antiDisturbance" />
      <el-table-column label="抗围困" align="center" prop="antiSiege" />
      <el-table-column label="抗风沙" align="center" prop="antiWind" />
      <el-table-column label="抗妖火" align="center" prop="antiFire" />
      <el-table-column label="抗毒术" align="center" prop="antiToxic" />
      <el-table-column label="抗落雷" align="center" prop="antiLightning" />
      <el-table-column label="属性点" align="center" prop="attributePoints" />
      <el-table-column label="备用属性点" align="center" prop="backupAttributePoint" />
      <el-table-column label="武器" align="center" prop="weapon" />
      <el-table-column label="头盔" align="center" prop="helmet" />
      <el-table-column label="护甲" align="center" prop="armor" />
      <el-table-column label="护腿" align="center" prop="legging" />
      <el-table-column label="鞋子" align="center" prop="shoe" />
      <el-table-column label="饰品" align="center" prop="jewelry" />
      <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
        <template slot-scope="scope">
          <el-button
            size="mini"
            type="text"
            icon="el-icon-edit"
            @click="handleUpdate(scope.row)"
            v-hasPermi="['system:entourage:edit']"
          >修改</el-button>
          <el-button
            size="mini"
            type="text"
            icon="el-icon-delete"
            @click="handleDelete(scope.row)"
            v-hasPermi="['system:entourage:remove']"
          >删除</el-button>
        </template>
      </el-table-column>
    </el-table>

    <pagination
      v-show="total>0"
      :total="total"
      :page.sync="queryParams.pageNum"
      :limit.sync="queryParams.pageSize"
      @pagination="getList"
    />

    <!-- 添加或修改玩家副将对话框 -->
    <el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
      <el-form ref="form" :model="form" :rules="rules" label-width="80px">
        <el-form-item label="预设副将ID" prop="entouragePresetsId">
          <el-input v-model="form.entouragePresetsId" placeholder="请输入预设副将ID" />
        </el-form-item>
        <el-form-item label="玩家ID" prop="playerId">
          <el-input v-model="form.playerId" placeholder="请输入玩家ID" />
        </el-form-item>
        <el-form-item label="名称" prop="name">
          <el-input v-model="form.name" placeholder="请输入名称" />
        </el-form-item>
        <el-form-item label="头像" prop="profilePicture">
          <el-input v-model="form.profilePicture" placeholder="请输入头像" />
        </el-form-item>
        <el-form-item label="等级" prop="LEVEL">
          <el-input v-model="form.LEVEL" placeholder="请输入等级" />
        </el-form-item>
        <el-form-item label="职业" prop="career">
          <el-input v-model="form.career" placeholder="请输入职业" />
        </el-form-item>
        <el-form-item label="头衔" prop="title">
          <el-input v-model="form.title" placeholder="请输入头衔" />
        </el-form-item>
        <el-form-item label="经验" prop="experience">
          <el-input v-model="form.experience" placeholder="请输入经验" />
        </el-form-item>
        <el-form-item label="忠诚" prop="loyalty">
          <el-input v-model="form.loyalty" placeholder="请输入忠诚" />
        </el-form-item>
        <el-form-item label="成长率" prop="growthRate">
          <el-input v-model="form.growthRate" placeholder="请输入成长率" />
        </el-form-item>
        <el-form-item label="兵力" prop="troops">
          <el-input v-model="form.troops" placeholder="请输入兵力" />
        </el-form-item>
        <el-form-item label="兵力上限" prop="troopsLimit">
          <el-input v-model="form.troopsLimit" placeholder="请输入兵力上限" />
        </el-form-item>
        <el-form-item label="精力" prop="energy">
          <el-input v-model="form.energy" placeholder="请输入精力" />
        </el-form-item>
        <el-form-item label="精力上限" prop="energyLimit">
          <el-input v-model="form.energyLimit" placeholder="请输入精力上限" />
        </el-form-item>
        <el-form-item label="防御力" prop="defenseCapability">
          <el-input v-model="form.defenseCapability" placeholder="请输入防御力" />
        </el-form-item>
        <el-form-item label="攻击" prop="attack">
          <el-input v-model="form.attack" placeholder="请输入攻击" />
        </el-form-item>
        <el-form-item label="速度" prop="speed">
          <el-input v-model="form.speed" placeholder="请输入速度" />
        </el-form-item>
        <el-form-item label="生平" prop="biography">
          <el-input v-model="form.biography" placeholder="请输入生平" />
        </el-form-item>
        <el-form-item label="无双" prop="unparalleled">
          <el-input v-model="form.unparalleled" placeholder="请输入无双" />
        </el-form-item>
        <el-form-item label="统御" prop="control">
          <el-input v-model="form.control" placeholder="请输入统御" />
        </el-form-item>
        <el-form-item label="谋略" prop="intelligence">
          <el-input v-model="form.intelligence" placeholder="请输入谋略" />
        </el-form-item>
        <el-form-item label="力量" prop="power">
          <el-input v-model="form.power" placeholder="请输入力量" />
        </el-form-item>
        <el-form-item label="敏捷" prop="agile">
          <el-input v-model="form.agile" placeholder="请输入敏捷" />
        </el-form-item>
        <el-form-item label="备用统御" prop="controlStandby">
          <el-input v-model="form.controlStandby" placeholder="请输入备用统御" />
        </el-form-item>
        <el-form-item label="备用谋略" prop="intelligenceStandby">
          <el-input v-model="form.intelligenceStandby" placeholder="请输入备用谋略" />
        </el-form-item>
        <el-form-item label="备用力量" prop="powerStandby">
          <el-input v-model="form.powerStandby" placeholder="请输入备用力量" />
        </el-form-item>
        <el-form-item label="备用敏捷" prop="agileStandby">
          <el-input v-model="form.agileStandby" placeholder="请输入备用敏捷" />
        </el-form-item>
        <el-form-item label="初始统御" prop="controlBase">
          <el-input v-model="form.controlBase" placeholder="请输入初始统御" />
        </el-form-item>
        <el-form-item label="初始谋略" prop="intelligenceBase">
          <el-input v-model="form.intelligenceBase" placeholder="请输入初始谋略" />
        </el-form-item>
        <el-form-item label="初始力量" prop="powerBase">
          <el-input v-model="form.powerBase" placeholder="请输入初始力量" />
        </el-form-item>
        <el-form-item label="初始敏捷" prop="agileBase">
          <el-input v-model="form.agileBase" placeholder="请输入初始敏捷" />
        </el-form-item>
        <el-form-item label="洗练统御" prop="controlSuccinct">
          <el-input v-model="form.controlSuccinct" placeholder="请输入洗练统御" />
        </el-form-item>
        <el-form-item label="洗练谋略" prop="intelligenceSuccinct">
          <el-input v-model="form.intelligenceSuccinct" placeholder="请输入洗练谋略" />
        </el-form-item>
        <el-form-item label="洗练力量" prop="powerSuccinct">
          <el-input v-model="form.powerSuccinct" placeholder="请输入洗练力量" />
        </el-form-item>
        <el-form-item label="洗练敏捷" prop="agileSuccinct">
          <el-input v-model="form.agileSuccinct" placeholder="请输入洗练敏捷" />
        </el-form-item>
        <el-form-item label="命中率" prop="hitRate">
          <el-input v-model="form.hitRate" placeholder="请输入命中率" />
        </el-form-item>
        <el-form-item label="暴击率" prop="criticalHitRate">
          <el-input v-model="form.criticalHitRate" placeholder="请输入暴击率" />
        </el-form-item>
        <el-form-item label="反击率" prop="counterattackRate">
          <el-input v-model="form.counterattackRate" placeholder="请输入反击率" />
        </el-form-item>
        <el-form-item label="致命率" prop="fatalityRate">
          <el-input v-model="form.fatalityRate" placeholder="请输入致命率" />
        </el-form-item>
        <el-form-item label="法暴率" prop="lawViolenceRate">
          <el-input v-model="form.lawViolenceRate" placeholder="请输入法暴率" />
        </el-form-item>
        <el-form-item label="反震率" prop="antiSeismicRate">
          <el-input v-model="form.antiSeismicRate" placeholder="请输入反震率" />
        </el-form-item>
        <el-form-item label="闪避率" prop="dodgeChance">
          <el-input v-model="form.dodgeChance" placeholder="请输入闪避率" />
        </el-form-item>
        <el-form-item label="抗物理" prop="antiPhysics">
          <el-input v-model="form.antiPhysics" placeholder="请输入抗物理" />
        </el-form-item>
        <el-form-item label="抗玄击" prop="antiXuanStrike">
          <el-input v-model="form.antiXuanStrike" placeholder="请输入抗玄击" />
        </el-form-item>
        <el-form-item label="抗封锁" prop="antiBlocking">
          <el-input v-model="form.antiBlocking" placeholder="请输入抗封锁" />
        </el-form-item>
        <el-form-item label="抗扰乱" prop="antiDisturbance">
          <el-input v-model="form.antiDisturbance" placeholder="请输入抗扰乱" />
        </el-form-item>
        <el-form-item label="抗围困" prop="antiSiege">
          <el-input v-model="form.antiSiege" placeholder="请输入抗围困" />
        </el-form-item>
        <el-form-item label="抗风沙" prop="antiWind">
          <el-input v-model="form.antiWind" placeholder="请输入抗风沙" />
        </el-form-item>
        <el-form-item label="抗妖火" prop="antiFire">
          <el-input v-model="form.antiFire" placeholder="请输入抗妖火" />
        </el-form-item>
        <el-form-item label="抗毒术" prop="antiToxic">
          <el-input v-model="form.antiToxic" placeholder="请输入抗毒术" />
        </el-form-item>
        <el-form-item label="抗落雷" prop="antiLightning">
          <el-input v-model="form.antiLightning" placeholder="请输入抗落雷" />
        </el-form-item>
        <el-form-item label="属性点" prop="attributePoints">
          <el-input v-model="form.attributePoints" placeholder="请输入属性点" />
        </el-form-item>
        <el-form-item label="备用属性点" prop="backupAttributePoint">
          <el-input v-model="form.backupAttributePoint" placeholder="请输入备用属性点" />
        </el-form-item>
        <el-form-item label="武器" prop="weapon">
          <el-input v-model="form.weapon" placeholder="请输入武器" />
        </el-form-item>
        <el-form-item label="头盔" prop="helmet">
          <el-input v-model="form.helmet" placeholder="请输入头盔" />
        </el-form-item>
        <el-form-item label="护甲" prop="armor">
          <el-input v-model="form.armor" placeholder="请输入护甲" />
        </el-form-item>
        <el-form-item label="护腿" prop="legging">
          <el-input v-model="form.legging" placeholder="请输入护腿" />
        </el-form-item>
        <el-form-item label="鞋子" prop="shoe">
          <el-input v-model="form.shoe" placeholder="请输入鞋子" />
        </el-form-item>
        <el-form-item label="饰品" prop="jewelry">
          <el-input v-model="form.jewelry" placeholder="请输入饰品" />
        </el-form-item>
        <el-form-item label="删除标志" prop="delFlag">
          <el-input v-model="form.delFlag" placeholder="请输入删除标志" />
        </el-form-item>
      </el-form>
      <div slot="footer" class="dialog-footer">
        <el-button type="primary" @click="submitForm">确 定</el-button>
        <el-button @click="cancel">取 消</el-button>
      </div>
    </el-dialog>
  </div>
</template>

<script>
import { listEntourage, getEntourage, delEntourage, addEntourage, updateEntourage } from "@/api/system/entourage"

export default {
  name: "Entourage",
  data() {
    return {
      // 遮罩层
      loading: true,
      // 选中数组
      ids: [],
      // 非单个禁用
      single: true,
      // 非多个禁用
      multiple: true,
      // 显示搜索条件
      showSearch: true,
      // 总条数
      total: 0,
      // 玩家副将表格数据
      entourageList: [],
      // 弹出层标题
      title: "",
      // 是否显示弹出层
      open: false,
      // 查询参数
      queryParams: {
        pageNum: 1,
        pageSize: 10,
        entouragePresetsId: null,
        playerId: null,
        name: null,
        profilePicture: null,
        sex: null,
        LEVEL: null,
        career: null,
        title: null,
        experience: null,
        loyalty: null,
        growthRate: null,
        troops: null,
        troopsLimit: null,
        energy: null,
        energyLimit: null,
        defenseCapability: null,
        attack: null,
        speed: null,
        biography: null,
        unparalleled: null,
        control: null,
        intelligence: null,
        power: null,
        agile: null,
        controlStandby: null,
        intelligenceStandby: null,
        powerStandby: null,
        agileStandby: null,
        controlBase: null,
        intelligenceBase: null,
        powerBase: null,
        agileBase: null,
        controlSuccinct: null,
        intelligenceSuccinct: null,
        powerSuccinct: null,
        agileSuccinct: null,
        hitRate: null,
        criticalHitRate: null,
        counterattackRate: null,
        fatalityRate: null,
        lawViolenceRate: null,
        antiSeismicRate: null,
        dodgeChance: null,
        antiPhysics: null,
        antiXuanStrike: null,
        antiBlocking: null,
        antiDisturbance: null,
        antiSiege: null,
        antiWind: null,
        antiFire: null,
        antiToxic: null,
        antiLightning: null,
        attributePoints: null,
        backupAttributePoint: null,
        weapon: null,
        helmet: null,
        armor: null,
        legging: null,
        shoe: null,
        jewelry: null,
      },
      // 表单参数
      form: {},
      // 表单校验
      rules: {
        entouragePresetsId: [
          { required: true, message: "预设副将ID不能为空", trigger: "blur" }
        ],
        playerId: [
          { required: true, message: "玩家ID不能为空", trigger: "blur" }
        ],
        name: [
          { required: true, message: "名称不能为空", trigger: "blur" }
        ],
        profilePicture: [
          { required: true, message: "头像不能为空", trigger: "blur" }
        ],
        sex: [
          { required: true, message: "性别不能为空", trigger: "change" }
        ],
      }
    }
  },
  created() {
    this.getList()
  },
  methods: {
    /** 查询玩家副将列表 */
    getList() {
      this.loading = true
      listEntourage(this.queryParams).then(response => {
        this.entourageList = response.rows
        this.total = response.total
        this.loading = false
      })
    },
    // 取消按钮
    cancel() {
      this.open = false
      this.reset()
    },
    // 表单重置
    reset() {
      this.form = {
        id: null,
        entouragePresetsId: null,
        playerId: null,
        name: null,
        profilePicture: null,
        sex: null,
        LEVEL: null,
        career: null,
        title: null,
        experience: null,
        loyalty: null,
        growthRate: null,
        troops: null,
        troopsLimit: null,
        energy: null,
        energyLimit: null,
        defenseCapability: null,
        attack: null,
        speed: null,
        biography: null,
        unparalleled: null,
        control: null,
        intelligence: null,
        power: null,
        agile: null,
        controlStandby: null,
        intelligenceStandby: null,
        powerStandby: null,
        agileStandby: null,
        controlBase: null,
        intelligenceBase: null,
        powerBase: null,
        agileBase: null,
        controlSuccinct: null,
        intelligenceSuccinct: null,
        powerSuccinct: null,
        agileSuccinct: null,
        hitRate: null,
        criticalHitRate: null,
        counterattackRate: null,
        fatalityRate: null,
        lawViolenceRate: null,
        antiSeismicRate: null,
        dodgeChance: null,
        antiPhysics: null,
        antiXuanStrike: null,
        antiBlocking: null,
        antiDisturbance: null,
        antiSiege: null,
        antiWind: null,
        antiFire: null,
        antiToxic: null,
        antiLightning: null,
        attributePoints: null,
        backupAttributePoint: null,
        weapon: null,
        helmet: null,
        armor: null,
        legging: null,
        shoe: null,
        jewelry: null,
        delFlag: null
      }
      this.resetForm("form")
    },
    /** 搜索按钮操作 */
    handleQuery() {
      this.queryParams.pageNum = 1
      this.getList()
    },
    /** 重置按钮操作 */
    resetQuery() {
      this.resetForm("queryForm")
      this.handleQuery()
    },
    // 多选框选中数据
    handleSelectionChange(selection) {
      this.ids = selection.map(item => item.id)
      this.single = selection.length!==1
      this.multiple = !selection.length
    },
    /** 新增按钮操作 */
    handleAdd() {
      this.reset()
      this.open = true
      this.title = "添加玩家副将"
    },
    /** 修改按钮操作 */
    handleUpdate(row) {
      this.reset()
      const id = row.id || this.ids
      getEntourage(id).then(response => {
        this.form = response.data
        this.open = true
        this.title = "修改玩家副将"
      })
    },
    /** 提交按钮 */
    submitForm() {
      this.$refs["form"].validate(valid => {
        if (valid) {
          if (this.form.id != null) {
            updateEntourage(this.form).then(response => {
              this.$modal.msgSuccess("修改成功")
              this.open = false
              this.getList()
            })
          } else {
            addEntourage(this.form).then(response => {
              this.$modal.msgSuccess("新增成功")
              this.open = false
              this.getList()
            })
          }
        }
      })
    },
    /** 删除按钮操作 */
    handleDelete(row) {
      const ids = row.id || this.ids
      this.$modal.confirm('是否确认删除玩家副将编号为"' + ids + '"的数据项？').then(function() {
        return delEntourage(ids)
      }).then(() => {
        this.getList()
        this.$modal.msgSuccess("删除成功")
      }).catch(() => {})
    },
    /** 导出按钮操作 */
    handleExport() {
      this.download('system/entourage/export', {
        ...this.queryParams
      }, `entourage_${new Date().getTime()}.xlsx`)
    }
  }
}
</script>
